<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.10/vue.js"></script>
</head>
<body>
<div id="app">
    <h1>{{fullName}}</h1>
</div>
<script>
    const vm = new Vue({
        el:"#app",
        data(){
            return{
                firstName:"xiao",
                lastName:"qi",
                fullName:""
            }
        },
        watch:{
                firstName:{
                    immediate:true,
                    handler() {
                        this.fullName = this.firstName.toUpperCase() + " " + this.lastName.toUpperCase()
                    }
                },
                lastName:{
                    immediate:true,
                handler(){
                    this.fullName = this.firstName.toUpperCase() + " " + this.lastName.toUpperCase()
                },
            },
        },
    });
</script>
</body>
</html>